package com.guldan.core.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Silas.
 * Date: 2017/2/22
 * Time: 14:39
 */
public enum FeedbackStateEn {

    notSee(10, "未查看"),
    hasSee(20, "已查看");

    private Integer code;
    private String mean;

    FeedbackStateEn(Integer code, String mean) {
        this.code = code;
        this.mean = mean;
    }

    public static FeedbackStateEn toEnum(Integer code) {
        FeedbackStateEn[] values = values();
        for (FeedbackStateEn en : values) {
            if (en.getCode().equals(code)) {
                return en;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getMean() {
        return mean;
    }

    public static List<EnumDTO> getList() {
        List<EnumDTO> list = new ArrayList<>();
        for (int k = 0; k < values().length; k++) {
            list.add(new EnumDTO(values()[k].getCode(), values()[k].getMean(), ""));
        }
        return list;
    }


}
